#define _CRT_SECURE_NO_WARNINGS 1



#include<stdio.h>
#include<string.h>


char a[200000] = { 0 }, b[200000] = { 0 };
int main()
{
	while (scanf("%s %s", a, b) != EOF)
	{
		int len_a = strlen(a), len_b = strlen(b), i = 0, flag = 1, j = 0;
		char temp = 0;
		if (strstr(a, b) != NULL)
		{
			flag = 0;
			printf("yes\n");
		}
		if (flag == 1)
		{
			for (i = 0; i < len_a; i++)
			{
				temp = a[0];
				for (j = 0; j < len_a; j++)
					a[j] = a[j + 1];
				a[len_a - 1] = temp;
				if (strstr(a, b) != NULL)
				{
					flag = 0;
					printf("yes\n");
					break;
				}
			}
			if (flag == 1)
				printf("no\n");
		}
	}

	return 0;
}